<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/28 0028
 * Time: 16:29
 */

namespace app\admin\model;
use think\Model;

class Admin extends Model
{
    protected $autoWriteTimestamp = 'datetime';
    //管理员添加模型方法
        public function admin_add($data){
            $admin=new Admin([
                'username' =>$data['username'],
                'password' =>$data['password'],
                'email'    =>$data['email'],
                'tel'      =>$data['tel'],
                'role'     =>$data['role'],
                'statu'    =>1
            ]);
            $admin=$admin->save();
            return $admin;
        }
}